﻿/// <reference path="_namespace.js" />
/// <reference path="../../IServiceProvider.js" />

/*****************************************************************************
Ajaxna library class definition. Inheriting from ajax.BaseObject.
Author: krobinson 10/21/2008 3:23:12 PM.
Class:  ajax.xna.framework.GameServiceContainer
*****************************************************************************/

$addNamespace("ajax.xna.framework");
//-----------------------------------------------------------------------------

ajax.xna.framework.GameServiceContainer = function()
{
    ajax.xna.framework.GameServiceContainer.superConstructor.apply(this, arguments);
}
$extend("ajax.xna.framework.GameServiceContainer", "ajax.BaseObject");
$supports("ajax.xna.framework.GameServiceContainer", "ajax.IServiceProvider");
if ($getDesignMode())
    ajax.xna.framework.GameServiceContainer.prototype = ajax.IServiceProvider.prototype;// ajax.BaseObject.prototype;
//-----------------------------------------------------------------------------

// Public members
//-----------------------------------------------------------------------------

// IServiceProvider interface
//-----------------------------------------------------------------------------
ajax.xna.framework.GameServiceContainer.prototype.getService = function(serviceTypeName)
{///<summary>Gets a service of the provided type (if exists).</summary>
    return this[serviceTypeName];
}

// Public Methods
//-----------------------------------------------------------------------------
ajax.xna.framework.GameServiceContainer.prototype.addService = function(serviceTypeName, service)
{///<summary>Adds a service of the provided type. Will supercede any previous service added of that type (if exists).</summary>
    this[serviceTypeName] = service;
}
//-----------------------------------------------------------------------------
ajax.xna.framework.GameServiceContainer.prototype.removeService = function(serviceTypeName)
{///<summary>Removes a service of the provided type.</summary>
    this[serviceTypeName] = null;
}


// Statics
//-----------------------------------------------------------------------------
ajax.xna.framework.GameServiceContainer.cast = function(obj)
{///<returns type="ajax.xna.framework.GameServiceContainer"/>
    return obj;
}